<template>
	<view class="parent-view">
		<view class="list-parent">
			<scroll-view class="sv-view" scroll-y="true" :show-scrollbar="false" @scrolltolower="onreachBottom">
				<view class="swiper-item-view">
					<!-- 修谱师管理 -->
					<view class="xpsl-view" v-for="(item , index) in xiupushiList" :key="index">
						<view class="xpsl-info-view">
							<text class="xpsl-name">{{item.nickname+item.nickcname}} {{item.mobile}}</text>
							<text class="xpsl-price">营业额：{{item.price}}</text>
						</view>
						<text class="xpsl-sure" @click="goSure" :data-index="item">确认</text>
					</view>
					<view style="width: 100%;height: 30rpx;"></view>
				</view>
			</scroll-view>
		</view>
	</view>
</template>

<script>
	import request from '../../pages/index/request.js';
	export default {
		data() {
			return {
				page: 1,
				jpmuseumid:"",
				jpcode:"",
				xiupushiList: [],
			}
		},
		methods: {
			onLoad: function(options) {
				this.jpmuseumid=options.jpmuseumid
				this.jpcode=options.jpcode
				this.getJpmuseumXpsList()
			},
			onShow: function() {
				this.share.url = '../../pages/tabBar/home/index?appInviteId=' + this.appUtil.getAppInviteId()
				this.share.shareType = 1
			},
			/** scroll-view到底部加载更多 */
			onreachBottom: function() {
				this.page = this.page + 1
				this.getJpmuseumXpsList()
			},
			getJpmuseumXpsList: function() {
				var that = this
				request.post("api/common/GetJpmuseumXpsList", {
					page: this.page,
					jpmuseumid: this.jpmuseumid,
				}).then(data => {
					if (this.page == 1) {
						that.xiupushiList = data
					} else {
						for (var i = 0; i < data.length; i++) {
							that.xiupushiList.push(data[i])
						}
					}
				})
			},
			goSure: function(event) {
				let item = event.currentTarget.dataset.index;
				var that = this
				request.post("api/common/PedigreeAlloutXPS", {
					jpcode: this.jpcode,
					jpmuseumid: this.jpmuseumid,
					XP_PQD:item.PQD
				}).then(data => {
					uni.$emit('refrash-list') 
					uni.navigateBack()
				})
			},
		}
	}
</script>

<style>
	@import "index.css";
</style>
